package cn.edu.ntu.yyl.dao;

import cn.edu.ntu.yyl.pojo.article.Article;
import cn.edu.ntu.yyl.pojo.user.UserFavorite;
import cn.edu.ntu.yyl.pojo.user.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserFavoriteDao {
    // 增
    Integer InsertNewUserCollect(UserFavorite userFavorite);
    // 删
    Integer DeleteUserCollect(UserFavorite userFavorite);
    // 改
    Integer UpdateUserCollect(UserFavorite userFavorite);
    // 查
    List<UserFavorite> SelectAllUserCollect();
    // 增
    Integer InsertNewUserFavorite(UserFavorite userFavorite);
    // 删
    Integer DeleteUserFavorite(UserFavorite userFavorite);
    // 改
    Integer UpdateUserFavorite(UserFavorite userFavorite);
    // 查
    List<UserFavorite> SelectAllUserFavorite();
    //按用户查询收藏
    List<UserFavorite> SelectCollectByUserId(UserInfo userInfo);
    //查询文章收藏量
    Integer SelectArticleCollectCount(Article article);
    //按用户查询点赞
    List<UserFavorite> SelectFavoriteByUserId(UserInfo userInfo);
    //查询文章点赞量
    Integer SelectArticleFavoriteCount(Article article);



}
